package com.bobi.tfca.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bobi.tfca.model.entity.MemberEntity;
import com.bobi.tfca.model.entity.MessageEntity;
import com.bobi.tfca.model.vo.MessageVO;

import java.util.List;

/**
 * 消息服务层
 * @author 李文发
 * @date 2024/4/3
 */
public interface MessageService extends IService<MessageEntity> {
    /**
     * 查询聊天室历史信息
     *
     * @param groupId 聊天室id
     * @param member
     * @return 消息列表
     */
    List<MessageVO> getCRHistoryMessages(Integer groupId, MemberEntity member);

    List<MessageVO> findAllLetters(Integer memberId);

    List<MessageVO> findAllNotifications(Integer memberId);

    MessageVO getLetterById(MemberEntity member, Long letterId);

    MessageVO getNotificationById(MemberEntity member, Long notificationId);

    Boolean writeLetter(Integer memberId, Integer receiverId, String letterContent);

    Boolean publishNotification(Integer memberId, String notificationContent);

    Integer getUnReadNotificationNum(Integer memberId);

    Integer getUnReadLetterNum(Integer memberId);

    long getUnReadMessageNum(Integer memberId, Integer groupId);

    void updateGroupMessageRead(Long messageId, MemberEntity member);

    Boolean checkNewMessage(MemberEntity member);
}
